################
#PSRM: Explaining Support for Redistribution: Social Insurance Systems and Fairness
#
#Observational Analysis ESS
#Load dataframes
#
#Verena Fetscher
#July 2022
####################



##########################
#Load data
##########################

load("DataFile_09_spending_tax.Rda")
load("DataFile_10_listwise.Rda")
load("DataFile_11_imputed.Rda")


##########################
#Create data frame from imputations
##########################

#Combine imputed data sets
data_imputed<-rbind(mi.out$imp1,mi.out$imp2,mi.out$imp3,mi.out$imp4,mi.out$imp5)

#Sample one imputed df
#Draw length of one imputed data frame from total imputed population
n<-length(mi.out$imp1$country)
data_imputed_sample<-data_imputed[sample(nrow(data_imputed), n,replace=F), ]

rm(n)
